﻿using System;
using System.Collections.Generic;
using System.Text;
using Pixysoft.Framework.Logs.Core;
using Pixysoft.TestDrivens;
using Pixysoft.Framework.Logs.Controller;

namespace Pixysoft.Framework.Logs.testdriven
{
    class tc_003
    {
        public void test()
        {
            Logger.GetLogger(StringHelper.default_log_prefix).Setting.LogPath = StringHelper.default_log_filepath;
            Logger.GetLogger(StringHelper.default_log_prefix).Setting.LogLevel = LogLevel.ALL;

            Logger.GetLogger(StringHelper.default_log_prefix).Info("helloworld");

            Assert.IsTrue(LogPackageController.Instance.GetCountOfLogFiles(Logger.GetLogger(StringHelper.default_log_prefix).Setting, 0) == 0);

            ILogPackage gzip = Logger.GetLogger(StringHelper.default_log_prefix).Package();

            (gzip as LogPackage).CreateDate = DateTime.MinValue;

            Assert.SaveOrVerify("gzip", gzip.Document.Records.Count);

            Assert.SaveOrVerify("unpack", Logger.GetLogger(StringHelper.default_log_prefix).Unpackage(gzip.Destination).Length);
        }

        public void unpack()
        {
        }
    }
}
